#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long ll;

ll N, S, T, A, B;

double f(ll x) {
    return A * (x - 1) / 2.0 + B * N * 1.0/ x;
}
int main() {
    cin >> N >> S >> T >> A >> B;

    ll minx = sqrt(2.0 * B * N / A);

    double res = 1e18;

    if (T >= S) res = min(res, A *1.0* (T - S));

    for (ll i = minx-1; i <= minx+1; i++) {
        if (i >= 1 && i < T) 
            res = min(res, f(i));
    }

    cout << fixed << setprecision(8) << res << endl;
}